<template>
  <div id="join">
    <div class="total">
      <div class="content">
        <div class="return">
          <span>姓名</span>
          <div class="input">
            <input type="text" placeholder="输入补货员姓名" v-model="name">
          </div>
        </div>
      </div>
      <div class="content">
        <div class="return">
          <span>手机号</span>
          <div class="input">
            <input type="text" placeholder="填写补货员的手机号作为登录账户" v-model="phone">
            <!-- <p :class="{choice: true,color: isColor}">选择加盟性质</p> -->
          </div>
        </div>
      </div>
      <div class="content">
        <div class="return">
          <span>密码</span>
          <div class="input">
            <input type="text" placeholder="为账号设置一个密码" v-model="password">
          </div>
        </div>
      </div>
      <div class="content">
        <div class="return">
          <span>补货方式</span>
          <div class="input join"  @click="displayMotai">
            <!-- <input type="text" placeholder="请填写您的手机号，方便我们联系您" v-model="phone"> -->
            <p :class="{choice: true,color: isColor}">请选择补货方式</p>
          </div>
        </div>
      </div>
      <div class="content">
        <div class="return">
          <span>绑定射频卡</span>
          <div class="input">
            <input type="text" placeholder="请上传射频卡">
          </div>
          <div class="imgs">
            <img src="../../../assets/tian1.png" alt="">
          </div>
        </div>
      </div>
    </div>
    <div class="bottom" @click="isSubmit">
      <div class="hand">
        <img src="../../../assets/tijiao.png" alt="">
        <span>提交</span>
      </div>
    </div>
    <div class="message" v-if="isSuccess">
      提交成功
    </div>
    <div class="message" v-if="isFaild">
      清输入您的建议
    </div>
    <!-- 模态框 -->
    <div class="motai" v-if="isMotai">
      <div class="model" @click="hideMotai">
        <div class="title public">选择补货方式</div>
        <div class="public" @click="gainName">扫码补货</div>
        <div class="public" @click="gainName">射频卡补货</div>
        <div class="public" @click="gainName">扫码补货和射频卡补货</div>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name: 'Join',
  data () {
    return {
      isSuccess: false,
      isFaild: false,
      name: '',
      phone: '',
      password: '',
      isMotai: false,
      isModel: false,
      choice: '',
      isColor: false
    }
  },
  created () {
    document.title = '添加补货员'
  },
  methods: {
    isSubmit () {
      if (this.suggest !== '') {
        this.isSuccess = true
      } else {
        this.isFaild = true
      }
    },
    displayMotai () {
      this.isMotai = true
      if (this.isMotai) {
        this.isModel = true
      }
    },
    hidden () {
      console.log('mmmm')
      this.isSuccess = false
      this.isFaild = false
    },
    hideMotai () {
      this.isMotai = false
      document.getElementsByClassName('choice')[0].innerText = this.choice
      this.isColor = true
      // var mm = document.getElementsByClassName('choice')[0].val()
      // console.log(mm)
    },
    gainName (e) {
      var message = e.target.innerText
      this.choice = message
    }
  }
}
</script>

<style lang='scss' scoped>
#join{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  .total{
    flex: 1;
    background-color: #fff;
    .content{
    flex: 1;
    padding: 5.33vw 3.46vw;
    background-color: #fff;
    .return{
      span{
        font-size: 3.73vw;
        font-family: SourceHanSansCN-Regular;
        font-weight: 400;
        color: rgba(168,168,168,1);
      }
      .input{
        height: 12.53vw;
        margin-top: 1.66vw;
        padding: 0 3.46vw;
        border-bottom: 1px solid #d8d8d8;
        &.join{
          height: 8.63vw;
          p{
            font-size: 4.53vw;
            font-family: SourceHanSansCN-Regular;
            font-weight: 400;
            color: rgba(192,192,192,1);
            margin-top: 6vw;
            &.color{
              font-family: SourceHanSansCN-Regular;
              font-weight: 400;
              color:rgba(22,22,22,1);
            }
          }
        }
        input{
          width: 100%;
          height: 93%;
          border: none;
          outline: none;
          font-family: SourceHanSansCN-Regular;
          font-weight: 400;
          color:rgba(22,22,22,1);
          font-size: 4.53vw;
        }
      }
      .imgs{
        margin-top: 1.2vw;
        margin-bottom: 18vw;
        img{
          width: 30.13vw;
          height: 30.13vw;
        }
      }
    }
    }
  }
  .bottom{
    width: 100%;
    height: 14.66vw;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    position: fixed;
    bottom: 0;
    .hand{
      color: #0A6DFF;
      img{
        width: 4.53vw;
        height: 4.53vw;
        margin-right: 2vw;
      }
      span{
        font-size: 4.53vw;
        font-family: SourceHanSansCN-Normal;
        font-weight: 400;
      }
    }
  }
  .message{
    width: 84vw;
    height: 10.4vw;
    background-color: #000;
    color: white;
    text-align: center;
    line-height: 10.4vw;
    font-size: 4.26vw;
    font-family: SourceHanSansCN-Regular;
    font-weight: 400;
    position: absolute;
    top: 76vw;
    left: 8vw;
    border-radius: 1vw;
  }
  .motai{
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    position: absolute;
    z-index: 250;
    .model{
      width: 100%;
      // height: 44vw;
      background-color: #fff;
      position: fixed;
      bottom: 0;
      border-radius: 2.13vw 2.13vw 0px 0px;
      .public{
        height: 14.66vw;
        line-height: 14.66vw;
        padding: 0 3.46vw;
        &.title{
          font-size: 3.73vw;
          font-family: SourceHanSansCN-Regular;
          font-weight: 400;
          color: rgba(134,134,134,1);
      }
      }
    }
  }
}
</style>
